Node-RED block in Snap4City Microservice library node-red-contrib-snap4city-developer is "bus-routes-search-within-gps-area">
It provides a list of the public transport routes that have a stop in a specified area.
Inputs
A JSON with these parameters:
- latitudebottomleft
number
- latitude of the Bottom Left Point of a rectangular area.
- longitudebottomleft
number
- longitude of the Bottom Left Point of a rectangular area.
- latitudetopright
number
- latitude of the Top Right Point of a rectangular area.
- longitudetopright
number
- longitude of the Top Right Point of a rectangular area.
- agency
string
- URI of an agency to restrict the search to a specified agency
- maxresults
number
- maximum number of results to be returned (if parameter is missing 100 is assumed), if it is 0 all results are returned
- geometry
boolean
- true/false, if true it returns a “hasGeometry” property for each service stating if the service has a complex WKT
geometries (linestring, polygon) associated with it (if parameter is missing “false” is assumed)
Outputs
- It provides a JSON Object with all the routes that have stops on the specified area. For each route the following
properties are provided: • lineNumber: the line short name • lineName: the line long name • route: the route
name • routeUri: an URI identifying the route (it can be used to retrieve all the stops of the route) • direction:
with first and last stop • agency: with agency name • agencyUri: with agency URI • polyline: with the WKT geometry
of the route
Details
The node can receive a JSON with the parameters described in the Inputs section and with them generate the output JSON.
If the values are not present in the input JSON, these are read by those in the configuration. If they are not present
in either part, an error is generated for the necessary parameters.